<me:UIVKADR x:Class="WPFExcelReport.TVKADR"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:KR="clr-namespace:WPFExcelReport;assembly=TKUNDADR" 
                    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF" 
                    xmlns:VKP="clr-namespace:WPFExcelReport;assembly=TVKPOS" 
                    xmlns:VV="clr-namespace:WPFExcelReport;assembly=TVVLIEF" 
                    xmlns:VVT="clr-namespace:WPFExcelReport;assembly=TVVTLIEF" 
                    FontSize="14"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIVKADR.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKADR.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <KR:TKUNDADR  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                      KUNDNR="{Binding KUNDNR,ElementName=TV}" 
                      dwKDR="{Binding dwKDR,ElementName=TV}"/>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel  Grid.Row="0" Grid.Column="0" >
                <WrapPanel    VerticalAlignment="Top">
                    <VKP:TSVK05 Name="cVK05"
                          KRS="{Binding KRS,ElementName=TV}"
                          LFD="{Binding LFD,ElementName=TV}"
                          POS="{Binding POS,ElementName=TV}"
                          AUF="{Binding VKP,ElementName=TV}"/>
                    <Grid Margin="10,0,0,0" VerticalAlignment="Top" IsEnabled="{Binding IsCanChg,ElementName=TV}" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button  Click="EditCommand" Width="24" Height="20">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                    <WrapPanel Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                        <Button Click="VKADRCommand" Content="{Binding Source={Localization:Translate Word=订单地址}}" Height="20" Margin="5,0,0,0" Width="Auto" />
                        <Button Click="VVADRCommand" Content="{Binding Source={Localization:Translate Word=发货地址}}" Height="20" Margin="5,0,0,0" Width="Auto" />
                        <Button Click="VRADRCommand" Content="{Binding Source={Localization:Translate Word=发票地址}}" Height="20" Margin="5,0,0,0" Width="Auto" />
                        <Grid Margin="10,0,0,0"  VerticalAlignment="Top"  >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                    </WrapPanel>
                </WrapPanel>
                <VK:TVK04 Name="cVK04" 
                          ORDERNUM="{Binding AUF,ElementName=cVK05}"
                          KUNDNR="{Binding KUNDNR,ElementName=TV}"
                          />
            </StackPanel>
            <StackPanel Grid.Row="1" Grid.Column="0">
                <StackPanel>
                    <WrapPanel>
                        <TextBlock   Text="{Binding Source={Localization:Translate Word=发货地址:}}"></TextBlock>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"  
                             Text="{Binding VKAKUNDNRK11}"   Width="100" />
                            <TextBlock Grid.Column="1"  Text="{Binding VKAADRSLK11,Converter={StaticResource gb2312}}"   Width="80" />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="80"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=公司名:}}"></TextBlock>
                            <ex:TXT72 MaxLength="40"  Grid.Column="1" CharacterCasing="Upper"  
                             Text="{Binding VKALNAME1,Converter={StaticResource gb2312}}" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="100" />
                        </Grid>
                        <WrapPanel>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=地址:}}"></TextBlock>
                            <ex:TXT72 MaxLength="40"  Grid.Column="1" CharacterCasing="Upper"  
                             Text="{Binding VKALSTRASSE1,Converter={StaticResource gb2312}}"
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="280" />

                            <ex:TXT72 MaxLength="40"  CharacterCasing="Upper"  Margin="10,0,0,0" 
                             Text="{Binding VKALSTRASSE2,Converter={StaticResource gb2312}}" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="280" />

                        </WrapPanel>
                    </WrapPanel>
                    <WrapPanel Margin="200,0,0,0"> 
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=联系人:}}"></TextBlock>
                        <TextBox Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKALBZBEZ,Converter={StaticResource gb2312}}"
                              MaxLength="13"
                             IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="200" />
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=联系方式:}}"></TextBlock>
                        <TextBox Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKALORT,Converter={StaticResource gb2312}}"
                              MaxLength="40"   IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  Width="200" />
                    </WrapPanel>
                </StackPanel>
                <StackPanel>
                    <WrapPanel>
                        <TextBlock   Text="{Binding Source={Localization:Translate Word=订单地址:}}"></TextBlock>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" 
                             Text="{Binding VKAKUNDNRK12}"  
                             Width="100" />
                            <TextBlock Grid.Column="1"  
                             Text="{Binding VKAADRSLK12,Converter={StaticResource gb2312}}" 
                              Width="80" />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=公司名:}}"></TextBlock>
                            <ex:TXT72 MaxLength="40"  Grid.Column="1" CharacterCasing="Upper"  
                             Text="{Binding VKABNAME1,Converter={StaticResource gb2312}}"
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="100" />
                        </Grid>
                        <WrapPanel>
                            <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=地址:}}"></TextBlock>
                            <ex:TXT72 MaxLength="40"  Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKABSTRASSE1,Converter={StaticResource gb2312}}" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="280" />
                            <ex:TXT72 MaxLength="40"  Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKABSTRASSE2,Converter={StaticResource gb2312}}" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="280" />
                        </WrapPanel>
                       
                    </WrapPanel>
                    <WrapPanel Margin="200,0,0,0">
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=联系人:}}"></TextBlock>
                        <TextBox Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKABPOSTF,Converter={StaticResource gb2312}}"
                             IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                             Width="200" />

                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=联系方式:}}"></TextBlock>
                        <TextBox Grid.Column="1" CharacterCasing="Upper"   
                             Text="{Binding VKABORT,Converter={StaticResource gb2312}}"
                              MaxLength="40"   IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  Width="200" />
                    </WrapPanel>
                </StackPanel>

                <WrapPanel>
                    <TextBlock   Text="{Binding Source={Localization:Translate Word=发票地址:}}"></TextBlock>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0"  
                             Text="{Binding VKAKUNDNR3}"  
                             Width="100" />
                        <TextBlock Grid.Column="1" 
                             Text="{Binding VKAADRSL3,Converter={StaticResource gb2312}}"  
                             Width="80" />
                    </Grid>
                </WrapPanel>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="1" Grid.Column="0">
                <WrapPanel>
                    <VV:TSVV08 Name="cVV" />
                </WrapPanel>
                <VVT:TVVTLIEF Name="cVVT"
                       VKP="{Binding AUF,ElementName=cVK05}" 
                    />
            </StackPanel>
            <VV:TVVLIEF Grid.Row="1" Grid.Column="1" Name="cSVV" 
                        IsAuto="False"
                        dwKDR="{Binding dwKDR,ElementName=TV}" 
                        dwVKVV="{Binding dwVKVV,ElementName=TV}"  
                        dwVKK="{Binding dwVKK,ElementName=cVK04}"                       
                        VVT="{Binding VVT,ElementName=cVVT}" 
                />
        </Grid>
    </Grid>
</me:UIVKADR>
